.mod-project.project-detail
	loading(ng-if="isLoading")
	.project-options
		button.ui-btn.ui-btn-md.ui-btn-bright(ng-click="openBuild(config.projectId,!!config.codeInfo)") 构建
		//- button.ui-btn.ui-btn-md.ui-btn-bright 部署
		a.ui-btn-delete(ng-click="deleteProject()")
			i.icon-delete
	tabset
		tab(heading="基本信息" active="tabActive[0].active" ui-sref="projectDetail.info")
			.code-origin 代码源：
				a(href="{{config.codeInfo.codeHttpUrl}}" target="_blank" ng-bind="config.codeInfo.codeHttpUrl")
				span(ng-if="!config.codeInfo") 该项目没有关联代码仓库
			.markdown(markdown projectid="projectId" branch="branch")
		tab(heading="项目配置" active="tabActive[1].active" ui-sref="projectDetail.config")
			div(name="projectForm" ng-form ng-class="{'need-valid':valid.needValid}").proInfo-form
				.dockerfile-options.pull-right
					button.ui-btn.ui-btn-sm.ui-btn-safe(ng-if="!edit" ng-click="getDockerfile()" ng-disabled="isLoading") 查看Dockerfile
					button.ui-btn.ui-btn-sm.ui-btn-bright(ng-click="checkEdit()" ng-show="!edit" ng-disabled="isLoading") 编辑
					button.ui-btn.ui-btn-sm.ui-btn-bright(ng-click="checkEdit()" ng-show="edit") 取消编辑
				ng-include(src="'index/tpl/tplProjectSetting/projectSettingInfoTpl.html'" ng-if="!edit")
				ng-include(src="'index/tpl/tplProjectSetting/projectSettingTpl.html'" ng-if="edit")
				.com-bottom-option(ng-show="edit")
					span.com-bottom-option-con
						button.ui-btn.ui-btn-md.ui-btn-bright(ng-click="checkEdit();valid.needValid = false;") 取消
						button.ui-btn.ui-btn-md.ui-btn-bright(ng-click="valid.needValid=true;validCreatedFileStoragePath();projectForm.$valid&&valid.createdFileStoragePath&&submitModify()" ng-disabled="isWaitingForModify") 保存修改
						button.ui-btn.ui-btn-md.ui-btn-safe(ng-click="valid.needValid=true;validCreatedFileStoragePath();projectForm.$valid&&valid.createdFileStoragePath&&getDockerfile()") 预览Dockerfile
						span.txt-error(ng-if="valid.needValid&&(!valid.createdFileStoragePath||projectForm.$invalid)") 存在不合法数据，请修改后提交！
		tab(heading="持续集成" active="tabActive[2].active" ui-sref="projectDetail.autobuild")
			p.tool-noinfo(ng-if="!config.codeInfo") 该项目未关联代码仓库，无法持续集成
			.ci-con(ng-if="config.codeInfo")
				span.ci-title 自动构建
				.ci-content
					p.txt-prompt 当所选分支更新或出现新tag时，会自动触发构建，生成新的项目镜像。请不要在频繁push的分支上开启自动构建，以免频繁触发构建，造成资源浪费。
					span.branch-check
						input#buildMaster.ui-check(type="checkbox" name="buildBranch" ng-model="config.autoBuildInfo.master")
						label(for="buildMaster") master
					span.branch-check
						input#buildTag.ui-check(type="checkbox" name="buildBranch"  ng-true-value="1"  ng-false-value="0" ng-model="config.autoBuildInfo.tag")
						label(for="buildTag") tag
					span.branch-check
						input#buildOther.ui-check(type="checkbox" name="buildBranch" ng-model="config.autoBuildInfo.other")
						label(for="buildOther" ng-if="!config.autoBuildInfo.other") 指定其他分支
						label(for="buildOther" ng-if="config.autoBuildInfo.other")
						input.ui-input-white(ng-model="config.autoBuildInfo.branches" ng-show="config.autoBuildInfo.other" placeholder="请输入分支名称，用逗号分隔 e.g. dev,fix-bug"  )
			.com-bottom-option(ng-show="config.codeInfo")
				button.ui-btn.ui-btn-md.ui-btn-bright(ng-click="modifyCI()" ng-disabled="isWaitingForModify") 保存修改
		tab(heading="构建记录" ng-click="getBuildList()" active="tabActive[3].active" ui-sref="projectDetail.buildlog")
			.chose-log
				span.chose-title 按状态筛选
				a.txt-chose(ng-class="{'active':statusKey=='Success'}" ng-click="toggleStatus('Success')") 成功
				a.txt-chose(ng-class="{'active':statusKey=='Fail'}" ng-click="toggleStatus('Fail')") 失败
				a.txt-chose(ng-class="{'active':statusKey=='Building'}" ng-click="toggleStatus('Building')") 构建中
				a.txt-chose(ng-class="{'active':statusKey=='Preparing'}" ng-click="toggleStatus('Preparing')") 准备中
				i.sep |
				span.chose-title 按构建模式筛选
				a.txt-chose(ng-class="{'active':autoBuildKey===0}" ng-click="toggleAutoBuild(0)") 手动构建
				a.txt-chose(ng-class="{'active':autoBuildKey===1}" ng-click="toggleAutoBuild(1)") 自动构建
			.build-log
				loglist
					table.ui-table-dome
						tbody
							tr(ng-if="!buildList||logFilterList.length===0")
								td(colspan="5") 无相关信息
							tr(ng-repeat="log in logFilterList = (buildList|filter:{'autoBuild':autoBuildKey,'state':statusKey})" ng-click="showDetail($index)")
								td(ng-cloak)
									i.icon-label( tooltip="镜像版本")
									| {{isNull(log.imageInfo.imageTag)}}
								td(ng-cloak ng-if="log.autoBuild!==1")
									i.icon-user(tooltip="构建者")
									| {{log.userInfo.userName}}
								td(ng-if="log.autoBuild==1") 自动构建
								td(ng-switch="log.state")
									span(ng-switch-when="Success" class="txt-success") 成功
									span(ng-switch-when="Fail" class="txt-warning") 失败
									span(ng-switch-when="Preparing" class="txt-normal") 准备中
									span(ng-switch-when="Send" class="txt-normal") 准备中
									span(ng-switch-default class="txt-normal") 构建中
								td(ng-bind="log.createTime")
								td(ng-bind="log.interval")
								td
									a.link-safe(href="{{log.logHref}}" target="_blank" ng-click="vmDome.stopPropagation($event)") 日志
								td
									i.icon-down.up(ng-class="{'up':$index!==currentIndex}")
		tab(heading="项目成员" ng-hide="!hasMemberPermisson" active="tabActive[4].active" ui-sref="projectDetail.user")
			div.tab-member(ng-include="'index/tpl/tplUserList/tplUserList.html'")